#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFileSystemModel>

typedef struct txtInf{
    int classNum;
    int groupNum;
    int modelNum;
    int runOid;
}txtInf_t;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void initUi();

    void writeSettings();

    void readSettings();

    virtual void closeEvent(QCloseEvent *event);

    void writeHex(QString filePath,QByteArray data);

    void make();

private slots:
    void on_setInputPathButton_clicked();

    void on_setOutputPathButton_clicked();

    void on_makeButton_clicked();

    void on_about_triggered();

    void on_help_triggered();

    void on_listView_clicked(const QModelIndex &index);

    void on_openButton_clicked();

    void on_dataWriteLoc_valueChanged(int arg1);

    void on_checkBox_clicked();


private:
    Ui::MainWindow *ui;
    QString curExePath;

    QString inPutPath;
    QString outPutPath;
    QString preOutPutPath;

    int dataWriteLoc;

    txtInf_t txtInf;

    QFileSystemModel *outPutModel;
    QFileSystemModel *inPutModel;

    int produceRunOid(txtInf_t txtInf);
    void createGame(txtInf_t txtInf,QList<int> content);
    int content2Int(QByteArray);
};

#endif // MAINWINDOW_H
